from celery.schedules import crontab


broker_url = 'redis://redis:6379/1'
result_backend = 'redis://redis:6379/0'

timezone = 'Asia/Shanghai'
task_serializer = 'json'
result_serializer = 'json'
accept_content = ['json']
worker_concurrency = 2
worker_prefetch_multiplier = 1
worker_max_tasks_per_child = 50
broker_connection_retry_on_startup = True

imports = (
    'ding_talk.tasks',
)

beat_schedule = {
    'add-every-min': {
         'task': 'ding_talk.tasks.notify_dev',
         'schedule': crontab(minute="30", hour="10", day_of_week="*"),
    },
    "add-prod-notify": {
        "task": "ding_talk.tasks.notify_prod",
        "schedule": crontab(minute="30", hour="10", day_of_week="4"),
    }
}
